<?php
class Zendvn_View_Helper_CmsFormHelp extends Zend_View_Helper_Abstract{
	//('.form-table #' . $key . '-error', $this->translate($val),null,array('type'=>'error','name'=>'#' .$key));
	
	public function cmsFormHelp($name, $value = '',$attribs = null,$options = null ){
		//echo '<br>' . __METHOD__;
		if($options == null){
		$xhtml = "$('" . $name . "').attr('title', '" . $value . "');
				 $('" . $name . "').cluetip({ 	splitTitle: '|', 
				 							  	cluetipClass: 'rounded', 
				 							  	showTitle: false,
				 							  	positionBy: 'fixed',
				 							  	width: 300,
				 							   
				 							   	fx: {
								                      open:       'show', // can be 'show' or 'slideDown' or 'fadeIn'
								                      openSpeed:  '50'
								    			}
											});

				 ";
		}else if($options['type'] =='error'){
			$xhtml = "$('" . $options['name'] . "').attr('style', 'background-color: #fff3f3;');
					  $('" . $name . "').cluetip({ splitTitle: '|', 
												   cluetipClass: 'error', 
												   showTitle: false,
												   fx: {
								                      open:       'slideDown', // can be 'show' or 'slideDown' or 'fadeIn'
								                      openSpeed:  '50'
								    					}
												});
					 ";
		}
		return $xhtml;
	}
}